package com.jeasonzhao.report.dataset;

public class Range
{
    private int BeginRowIndex = 0;
    private int EndRowIndex = 0;
    private int BeginColIndex = 0;
    private int EndColIndex = 0;
    public Range()
    {
    }

    public int getBeginColIndex()
    {
        return BeginColIndex;
    }

    public int getBeginRowIndex()
    {
        return BeginRowIndex;
    }

    public int getEndColIndex()
    {
        return EndColIndex;
    }

    public int getEndRowIndex()
    {
        return EndRowIndex;
    }

    public void setEndRowIndex(int EndRowIndex)
    {
        this.EndRowIndex = EndRowIndex;
    }

    public void setEndColIndex(int EndColIndex)
    {
        this.EndColIndex = EndColIndex;
    }

    public void setBeginRowIndex(int BeginRowIndex)
    {
        this.BeginRowIndex = BeginRowIndex;
    }

    public void setBeginColIndex(int BeginColIndex)
    {
        this.BeginColIndex = BeginColIndex;
    }

    public boolean isContains(int nRowIndex,int nColIndex)
    {
        return BeginRowIndex <= nRowIndex && EndRowIndex >= nRowIndex &&
            BeginColIndex <= nColIndex && EndColIndex >= nColIndex;
    }

    public boolean isTopLeft(int nRowIndex,int nColIndex)
    {
        return BeginRowIndex == nRowIndex &&
            BeginColIndex == nColIndex;
    }

}
